package cqie.personal.frame.bo;

public class GetClassCourseBO {
    private Integer id;
    private String courseName;
    private Integer classId;
    private String teacherName;
    private Integer teacherId;
    private Integer pageNo;
    private Integer pageSize;
    private Integer pageOffset;

    public GetClassCourseBO(){
        pageSize=5;
        pageNo=1;
        setPageOffset();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        if(!courseName.equals("")) {
            if(!courseName.replace(" ","").equals("")) {
                this.courseName = courseName;
            }
        }
    }

    public Integer getClassId() {
        return classId;
    }

    public void setClassId(Integer classId) {
        this.classId = classId;
    }

    public String getTeacherName() {
        return teacherName;
    }

    public void setTeacherName(String teacherName) {
        if(!teacherName.equals("")) {
            if(!teacherName.replace(" ","").equals("")) {
                this.teacherName = teacherName;
            }
        }
    }

    public Integer getTeacherId() {
        return teacherId;
    }

    public void setTeacherId(Integer teacherId) {
        this.teacherId = teacherId;
    }

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        if(pageNo>0) {
            this.pageNo = pageNo;
            setPageOffset();
        }
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        if(pageSize>0) {
            this.pageSize = pageSize;
            setPageOffset();
        }
    }

    public Integer getPageOffset() {
        return pageOffset;
    }

    private void setPageOffset() {
        pageOffset = (pageNo-1)*pageSize;
    }
}
